<h1  >ใบสั่งซื้อ (Order)</h1>

<div class="company" >

ผู้สั่งซื้อ: <?php echo $row["firstname"]." ".$row["lastname"]; ?>

<br/>
......................................................................................................................................................................................................................
<br/>
<?php $this->db->where("order_id",$order_id); 

$rows = $this->db->get("order_item_views")->result_array();

?>
ผู้ขาย: <?php echo $row["company_name"]; ?><br/>
ที่อยู่ <?php echo $row["address"]; ?><br/>
เบอร์โทร: <?php echo $row["tel"]; ?>

</div>
<br/>
<?php setlocale(LC_MONETARY, "th_TB"); ?>
รานการสั่งซื้อดังนี้
<table class="list" style="width:100%" >
          <tbody><tr class=" odd">
            <th style="width:30px;">ลำดับ</th>
            <th style="width:400px;"> ชื่อ/รายละเอียด</th>
            
           
             <th class="ct" style="width:90px;">จำนวน</th>
             <th class="ct" style="width:90px;">ราคาต่อหน่วย(บาท)</th>
              <th class="ct" style="width:90px;">ราคารวม(บาท)</th>
          </tr>
         <?php
          $i = 1;
          $sum_price =  0;
          foreach($rows as $item){ 
          $sum_price += ($item["price"] * $item["amount"]);
          	?>
        
          <tr class="<?php if($i%2){ echo "even";} ?>" >
            
            <td><?php echo $i++; ?></td>
            <td><?php echo $item['category_name']." ".$item["detail"].""; ?></td>
            
            <td class="ct bdl" ><?php echo $item['amount']; ?></td>
             <td class="ct bdl" ><?php echo number_format(  $item['price'],2,".",","); ?></td>
             <td class="ct bdl" ><?php echo number_format( ($item['amount'] * $item["price"]),2,".",","); ?></td>
          </tr>
          <?php } ?>
        </tbody></table>
<div class="remark">
จำนวนเงินตัวอักษร: <?php 
$vat_price =(($sum_price*7)/100);
$last_price = ($sum_price+$vat_price);
echo $this->p->num2thai($last_price); ?>
<br/>หมายเหตุ<br/><?php echo $row["remark"]; ?></div>
<div class="summary">ราคาสินค้า: <?php echo number_format( $sum_price,2,".",","); ?> บาท <br/>
Vat(7%): <?php   echo  number_format($vat_price,2,".",","); ?> บาท <br/>
ราคาสุธิ : <?php echo number_format($last_price,2,".",",");  ?> บาท </div>
<div class="clear"></div>

<div>
<div class="signin">
ลงชื่อ............................................
<br/>     (<?php echo "               ".$row["firstname"]." ".$row["lastname"]; ?>)


</div>

<div class="clear"></div>


</div>